package ru.fadeev.crammer.ui;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

public class BasicCellRenderer extends DefaultTableCellRenderer {
	
    public final static Color selectionColor = new Color(220,220,255);

    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                                                boolean hasFocus, int row, int column) {
        Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
        cell.setForeground(Color.black);
        if(isSelected)
            cell.setBackground(selectionColor);
        else
            cell.setBackground(Color.white);
        return cell;
    }
}
